import request from '_utils/request'
// 获取商品列表
const getItemLists = (params = {}) => (
  request.get('/itemLists', { params })
)
// 获取商品分类列表
const getCateLists = (params = {}) => (
  request.get('/cateLists', { params })
)
// 新增商品分类
const addCate = (params = {}) => (
  request.post('/addCate', params)
)
// 修改商品分类
const updateCate = (params = {}) => (
  request.put('/updateCate', params)
)
// 删除分类
const delCate = (id) => (
  request.delete('/delCate', { params: { id } })
)
// 新增商品
const addItem = (params = {}) => (
  request.post('/addItem', params)
)
// 获取商品详情 getItemDetail
const getItemDetail = id => (
  request.get('/getItemDetail', { params: { id } })
)
// 更新商品
const updateItem = (params = {}) => (
  request.put('/updateItem', params)
)
// 用户登录
const userLogin = (params = {}) => (
  request.post('/login', params)
)
export {
  getItemLists,
  getCateLists,
  addCate,
  updateCate,
  delCate,
  addItem,
  getItemDetail,
  updateItem,
  userLogin
}
